home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
doom
/
cddk9605.zip
/
HEADERS.ARJ
/
MATH.INT
< prev
next >
Wrap
Text File
|
1996-05-17
|
5KB
|
137 lines
{ ───────────────────────────────────────────────────────────────────────── }
{ Name : MATH.PAS }
{ Description : Mathematics }
{ ───────────────────────────────────────────────────────────────────────── }
UNIT Math;
{$B-} { . . . . . . . . . . . . . . . . . . . . Shortcut boolean evaluation }
{$F+} { . . . . . . . . . . . . . . . . . . . . Force far calls for safety }
{$I-} { . . . . . . . . . . . . . . . . . . . Disable input/output checking }
{$O+} { . . . . . . . . . . . . . . . . . . Allow this unit to be overlayed }
{$Q-} { . . . . . . . . . . . . . . Do not generate overflow-checking code }
{$R-} { . . . . . . . . . . . . . . . . Do not generate range-checking code }
{$S-} { . . . . . . . . . . . . . . . . Do not generate stack-checking code }
{$X+} { . . . . . . . . . . . Extended syntax for pChars and function calls }
INTERFACE
TYPE
{ Turbo Pascal Real Types }
{ }
{ ┌────────────┬─────────────────────┬────────┬────┐ }
{ │ Real │ 2.9e-39..1.7e38 │ 11-12 │ 6 │ }
{ │ + Single │ 1.5e-45..3.4e38 │ 7-8 │ 4 │ }
{ │ + Double │ 5.0e-324..1.7e308 │ 15-16 │ 8 │ }
{ │ + Extended │ 3.4e-4932..1.1e4932 │ 19-20 │ 10 │ }
{ │ + Comp │ -9.2e18..9.2e18 │ 19-20 │ 8 │ }
{ └────────────┴─────────────────────┴────────┴────┘ }
{ + MathCo required }
{$IFOPT N+}
Float = Extended;
{$ELSE}
Float = Real;
{$ENDIF}
tComplex = OBJECT
a : Float;
b : Float;
PROCEDURE Add(CONST C:tComplex);
FUNCTION Magnitude:Float;
PROCEDURE Multiply(CONST C:tComplex);
PROCEDURE Subtract(CONST C:tComplex);
END;
pComplex = ^tComplex;
tFunction = FUNCTION (x:Float):Float;
{ Angle Conversions }
FUNCTION Deg_Grd (CONST D:Float) : Float; { Degrees -> Gradians }
FUNCTION Deg_Rad (CONST D:Float) : Float; { Degrees -> Radians }
FUNCTION Grd_Deg (CONST G:Float) : Float; { Gradians -> Degrees }
FUNCTION Grd_Rad (CONST G:Float) : Float; { Gradians -> Radians }
FUNCTION Rad_Deg (CONST R:Float) : Float; { Radians -> Degrees }
FUNCTION Rad_Grd (CONST R:Float) : Float; { Radians -> Gradians }
{ Area Functions }
FUNCTION Area_Circle(CONST Radius:Float):Float;
FUNCTION Area_Ellipse(CONST R1,R2:Float):Float;
FUNCTION Area_Equilateral_Triangle(CONST S:Float):Float;
FUNCTION Area_Rectangle(CONST X,Y:Float):Float;
FUNCTION Area_Sector(CONST Radius, Angle:Float):Float;
FUNCTION Area_Square(CONST Side:Float):Float;
FUNCTION Area_Trapezoid(CONST A,B,H:Float):Float;
FUNCTION Area_Triangle(CONST Base,Height:Float):Float;
{ Calculus }
FUNCTION Simpson(CONST y:tFUNCTION; CONST a,b,n:LongInt):Float;
{ Circumference Functions }
FUNCTION Circum_Circle(CONST R:Float):Float;
FUNCTION Circum_Ellipse(CONST R1,R2:Float):Float;
{ Hyperbolic Functions }
FUNCTION COSH(CONST R:Float):Float; { Hyperbolic Cosine }
FUNCTION COTH(CONST R:Float):Float; { Hyperbolic Cotangent }
FUNCTION SECH(CONST R:Float):Float; { Hyperbolic Secant }
FUNCTION SINH(CONST R:Float):Float; { Hyperbolic Sine }
FUNCTION TANH(CONST R:Float):Float; { Hyperbolic tangent }
{ Minimum/Maximum Functions }
FUNCTION MaxS(A,B:ShortInt) : ShortInt;
FUNCTION MinS(A,B:ShortInt) : ShortInt;
FUNCTION MaxB(A,B:Byte) : Byte;
FUNCTION MinB(A,B:Byte) : Byte;
FUNCTION MaxI(A,B:Integer) : Integer;
FUNCTION MinI(A,B:Integer) : Integer;
FUNCTION MaxW(A,B:Word) : Word;
FUNCTION MinW(A,B:Word) : Word;
{ Surface Area Functions }
FUNCTION Surface_Area_Box(CONST L,W,H:Float):Float;
FUNCTION Surface_Area_Cone(CONST Radius,Height:Float):Float;
FUNCTION Surface_Area_Cylinder(CONST Radius,Height:Float):Float;
FUNCTION Surface_Area_Cube(CONST Side:Float):Float;
FUNCTION Surface_Area_Sphere(CONST Radius:Float):Float;
{ Trigonomic Functions }
FUNCTION COT(CONST R:Float):Float; { Cotangent }
FUNCTION CSC(CONST R:Float):Float; { Cosecant }
FUNCTION SEC(CONST R:Float):Float; { Secant }
FUNCTION TAN(CONST R:Float):Float; { Tangent }
{ Volume Functions }
FUNCTION Volume_Box(CONST X,Y,Z:Float):Float;
FUNCTION Volume_Cone(CONST Radius,Height:Float):Float;
FUNCTION Volume_Cube(CONST Side:Float):Float;
FUNCTION Volume_Cylinder(CONST Radius,Height:Float):Float;
FUNCTION Volume_Sphere(CONST Radius:Float):Float;
{ Misc/Unsorted Functions }
FUNCTION Distance(X1,Y1,X2,Y2:Float):Float;
FUNCTION Factorial(N:LongInt):LongInt;
FUNCTION GCF(N1,N2:LongInt):LongInt;
FUNCTION LCM(N1,N2:LongInt):LongInt;
FUNCTION nCr(N,R:LongInt):LongInt;
FUNCTION nPr(N,R:LongInt):LongInt;
FUNCTION NLogX(N,X:Float):Float;
FUNCTION Prime(N:LongInt):Boolean;
FUNCTION Pythagoras(A,B:Float):Float;
FUNCTION Within_Box(X,Y,X1,Y1,X2,Y2:LongInt):Boolean;